# -*- coding: utf-8 -*-
from pyheatmap.heatmap import HeatMap
import numpy as np
from matplotlib import pyplot as plt

# from heatmaplib.heatmap import Heatmap
# need download pyheatmap by pip
# data format point(x, y),r,r is avg bounding box radius
N = 40
X = np.random.rand(N) * 255  # [0, 255]
Y = np.random.rand(N) * 255
data = []
for i in range(N):
    tmp = [int(X[i]), int(Y[i]), 1]
    data.append(tmp)
heat = HeatMap(data)
# img = heat.heatmap(points)

# heat.heatmap(save_as="2.png") #热图
plt.imshow(heat.heatmap(r=50))
plt.show()
# heat.clickmap(save_as="1.png") #点击图
# heat.heatmap(save_as="2.png") #热图
